﻿
namespace bookMaster.AssetSystem.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.Prueba"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class PruebaEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the IdPrueba property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIdPrueba;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IdPrueba property.
		/// </summary>
		protected System.Windows.Forms.Label uxIdPruebaLabel;
		
		/// <summary>
		/// TextBox for the Nombre property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxNombre;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Nombre property.
		/// </summary>
		protected System.Windows.Forms.Label uxNombreLabel;
		
		/// <summary>
		/// TextBox for the Apellido property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxApellido;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Apellido property.
		/// </summary>
		protected System.Windows.Forms.Label uxApellidoLabel;
		#endregion
		
		#region Main entity
		private Entities.Prueba _Prueba;
		/// <summary>
		/// Gets or sets the <see cref="Entities.Prueba"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.Prueba"/> instance.</value>
		public Entities.Prueba Prueba
		{
			get {return this._Prueba;}
			set
			{
				this._Prueba = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxIdPrueba.DataBindings.Clear();
			this.uxIdPrueba.DataBindings.Add("Text", this.uxBindingSource, "IdPrueba", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxNombre.DataBindings.Clear();
			this.uxNombre.DataBindings.Add("Text", this.uxBindingSource, "Nombre", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxApellido.DataBindings.Clear();
			this.uxApellido.DataBindings.Add("Text", this.uxBindingSource, "Apellido", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="PruebaEditControlBase"/> class.
		/// </summary>
		public PruebaEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_Prueba != null) _Prueba.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxIdPrueba = new System.Windows.Forms.TextBox();
			uxIdPruebaLabel = new System.Windows.Forms.Label();
			this.uxNombre = new System.Windows.Forms.TextBox();
			uxNombreLabel = new System.Windows.Forms.Label();
			this.uxApellido = new System.Windows.Forms.TextBox();
			uxApellidoLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIdPruebaLabel
			//
			this.uxIdPruebaLabel.Name = "uxIdPruebaLabel";
			this.uxIdPruebaLabel.Text = "Id Prueba:";
			this.uxIdPruebaLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIdPruebaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIdPruebaLabel);			
			//
			// uxIdPrueba
			//
			this.uxIdPrueba.Name = "uxIdPrueba";
			this.uxIdPrueba.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxIdPrueba);
			this.uxIdPrueba.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxIdPrueba);
			//
			// uxNombreLabel
			//
			this.uxNombreLabel.Name = "uxNombreLabel";
			this.uxNombreLabel.Text = "Nombre:";
			this.uxNombreLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxNombreLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxNombreLabel);			
			//
			// uxNombre
			//
			this.uxNombre.Name = "uxNombre";
			this.uxNombre.Width = 250;
			this.uxNombre.MaxLength = 50;
			//this.uxTableLayoutPanel.Controls.Add(this.uxNombre);
			this.uxNombre.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxNombre);
			//
			// uxApellidoLabel
			//
			this.uxApellidoLabel.Name = "uxApellidoLabel";
			this.uxApellidoLabel.Text = "Apellido:";
			this.uxApellidoLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxApellidoLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxApellidoLabel);			
			//
			// uxApellido
			//
			this.uxApellido.Name = "uxApellido";
			this.uxApellido.Width = 250;
			this.uxApellido.MaxLength = 50;
			//this.uxTableLayoutPanel.Controls.Add(this.uxApellido);
			this.uxApellido.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxApellido);
			// 
			// PruebaEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "PruebaEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
		
		#endregion
		
        #region Field visibility

        /// <summary>
        /// Indicates if the controls associated with the uxIdPrueba property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxIdPruebaVisible
        {
            get { return this.uxIdPrueba.Visible; }
            set
            {
                this.uxIdPruebaLabel.Visible = value;
                this.uxIdPrueba.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxIdPrueba property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxIdPruebaEnabled
        {
            get { return this.uxIdPrueba.Enabled; }
            set
            {
                this.uxIdPrueba.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxNombre property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxNombreVisible
        {
            get { return this.uxNombre.Visible; }
            set
            {
                this.uxNombreLabel.Visible = value;
                this.uxNombre.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxNombre property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxNombreEnabled
        {
            get { return this.uxNombre.Enabled; }
            set
            {
                this.uxNombre.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxApellido property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxApellidoVisible
        {
            get { return this.uxApellido.Visible; }
            set
            {
                this.uxApellidoLabel.Visible = value;
                this.uxApellido.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxApellido property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxApellidoEnabled
        {
            get { return this.uxApellido.Enabled; }
            set
            {
                this.uxApellido.Enabled = value;
            }
        }

        #endregion

		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
